package org.example;

public class Product {
    private String id;
    private String name;
    private double price;
    private int quantity;
    public Product() {

    }
    //构造方法
    public Product(String id, String name, double price, int quantity) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.quantity = quantity;
    }
    public String getId(){
            return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
    public void result() {
        System.out.println("商品编号: " + id);
        System.out.println("商品名称: " + name);
        System.out.println("商品单价: " + price + "元");
        System.out.println("库存数量: " + quantity);
    }
}


